from typing import Optional, List
import os
# from langchain.embeddings import QianfanEmbeddingsEndpoint
from langchain.embeddings import QianfanEmbeddingsEndpoint

AK = '2jCwbiCWReSVlPbt53f9pYhP'
SK = 'dwJ8BULLCsBMXsmtjyxNI8hkw4y0HPXq'
os.environ['QIANFAN_AK'] = AK
os.environ['QIANFAN_SK'] = SK

embed = QianfanEmbeddingsEndpoint()

res1 = embed.embed_query('这是第一个测试文档')
print(res1)
print(len(res1))
res2 = embed.embed_documents(['这是第一个测试文档', '这是第二个测试文档'])
print(res2)
print(len(res2))